package com.lz.service.excel.dem;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;

public class mian {
    public static void main(String[] args) {
        ArrayList<Test> tests = new ArrayList<>();
        tests.add(new Test("1", 1));
        tests.add(new Test("2", 2));
        tests.add(new Test("3", 3));
        File file = new Test().generateExcelFile(tests);
        //把file下载到本地C://
        try {
            file.createNewFile();
            String path = "E:\\resource\\layout\\LZ-Excel\\" + file.getName();
            System.out.println(path);
            FileUtils.copyFile(file, new File(path));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }
}
